<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/sys/header.html">
    <style>
        .upload-list {
            display: inline-block;
            width: 60px;
            height: 60px;
            text-align: center;
            line-height: 60px;
            border: 1px solid transparent;
            border-radius: 4px;
            overflow: hidden;
            background: #fff;
            position: relative;
            box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
            margin-right: 4px;
        }

        .upload-list img {
            width: 100%;
            height: 100%;
        }

        .upload-list-cover {
            display: none;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, .6);
        }

        .upload-list:hover .upload-list-cover {
            display: block;
        }

        .upload-list-cover i {
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            margin: 0 2px;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="buttons-group">
            <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
            </div>
        </Row>
<table id="jqGrid"></table>
<div id="jqGridPager"></div>
</div>

<Card v-show="!showList">
    <p slot="title">{{title}}</p>

    <Tabs value="name1">
        <Tab-Pane label="通用信息" name="name1">
            <i-form ref="formValidate" :model="goods" :rules="ruleValidate" :label-width="100">
                <Form-item label="名称" prop="name">
                    <i-input v-model="goods.name" placeholder="名称"/>
                </Form-item>

                <Form-item label="原价" prop="marketPrice">
                    <Input-number :min="0" :step="1" v-model="goods.marketPrice" disabled="disabled" placeholder="原价"
                                  style="width: 188px;"/>
                </Form-item>
                <Form-item label="当前折扣" prop="discount">
                    <Input-number :min="0" :max="1" v-model="goods.discount" disabled="disabled" placeholder="折扣" style="width: 188px;" />
                </Form-item>
                <Form-item label="当前折后价格" prop="retailPrice">
                    <Input-number :min="0" :step="1" v-model="goods.retailPrice" disabled="disabled" placeholder="折后价格"
                                  style="width: 188px;"/>
                </Form-item>
                <Form-item label="折扣" prop="discount">
                    <Input-number :min="0" :max="1" v-model="goods.discount" placeholder="折扣" style="width: 188px;" />
                </Form-item>
                <i-button type="primary" @click="estimate()">估算</i-button><p>预估折扣后价格：{{discounted}}</p>

            </i-form>
        </Tab-Pane>
        <Tab-Pane label=".." name="name2">
            <template>
                <Upload
                        ref="upload"
                        :show-upload-list="false"
                        :default-file-list="uploadList"
                        :on-success="handleSuccess"
                        :format="['jpg','jpeg','png']"
                        :max-size="2048"
                        :on-format-error="handleFormatError"
                        :on-exceeded-size="handleMaxSize"
                        :before-upload="handleBeforeUpload"
                        multiple
                        type="drag"
                        action="../sys/oss/upload"
                        style="display: inline-block;width:58px;">
                     <div style="width: 58px;height:58px;line-height: 58px;">
                     <Icon type="camera" size="20"></Icon>
                      </div>
                </Upload>
            </template>

        </Tab-Pane>
    </Tabs>
    <div style="padding-left: 20px; margin-bottom: 30px">
        <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
        <i-button type="warning" @click="reload" style="margin-left: 8px"/>
        返回</i-button>
<!--   <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>-->
    </div>
</Card>
</div>

<!-- 选择类型 -->
<div id="categoryLayer" style="display: none;padding:10px;">
    <ul id="categoryTree" class="ztree"></ul>
</div>

<script src="${rc.contextPath}/static/js/shop/goodss.js?_${.now?long}"></script>
</body>
</html>
